Installing VSCP on a Raspberry Pi
Here’s an overview of how to install vscp_software on a Raspberry Pi. It is based on the tutorial on setting up the VSCP daemon on Unix. I’m not only giving the commands but also the verbose output for most commands, so grease up your scroll wheel :-)
Updating the system
First we need to make sure all installed packages on our system are up-to-date. We’ll do this by issuing sudo apt-get update to update the package list and status, and sudo apt-get upgrade to upgrade those which have newer versions.
root@raspberrypi:~# apt-get update
Get:1 http://raspberrypi.collabora.com wheezy Release.gpg [836 B]
Get:2 http://vontaene.de . Release.gpg [198 B]
Get:3 http://archive.raspberrypi.org wheezy Release.gpg [490 B]
Get:4 http://mirrordirector.raspbian.org wheezy Release.gpg [490 B]
Get:5 http://www.linux-projects.org wheezy Release.gpg [198 B]
Get:6 http://archive.raspbian.org wheezy Release.gpg [490 B]
Hit http://vontaene.de . Release
Get:7 http://raspberrypi.collabora.com wheezy Release [7,514 B]
Get:8 http://www.linux-projects.org wheezy Release [924 B]
Get:9 http://archive.raspberrypi.org wheezy Release [10.2 kB]
Get:10 http://mirrordirector.raspbian.org wheezy Release [14.4 kB]
Get:11 http://archive.raspbian.org wheezy Release [14.4 kB]
Ign http://vontaene.de . Release
Get:12 http://raspberrypi.collabora.com wheezy/rpi armhf Packages [2,214 B]
Get:13 http://www.linux-projects.org wheezy/main armhf Packages [1,697 B]
Hit http://vontaene.de ./main armhf Packages
Ign http://vontaene.de ./main Translation-en_GB
Get:14 http://archive.raspberrypi.org wheezy/main armhf Packages [108 kB]
Ign http://vontaene.de ./main Translation-en
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en_GB
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en
Get:15 http://archive.raspbian.org wheezy/main Sources [6,080 kB]
Ign http://www.linux-projects.org wheezy/main Translation-en_GB
Ign http://www.linux-projects.org wheezy/main Translation-en
Get:16 http://mirrordirector.raspbian.org wheezy/main armhf Packages [6,896 kB]
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB
Ign http://archive.raspberrypi.org wheezy/main Translation-en
Get:17 http://archive.raspbian.org wheezy/contrib Sources [53.2 kB]
Get:18 http://archive.raspbian.org wheezy/non-free Sources [98.5 kB]
Get:19 http://archive.raspbian.org wheezy/main armhf Packages [6,896 kB]
Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en
Get:20 http://archive.raspbian.org wheezy/contrib armhf Packages [23.6 kB]
Get:21 http://archive.raspbian.org wheezy/non-free armhf Packages [49.3 kB]
Ign http://archive.raspbian.org wheezy/contrib Translation-en_GB
Ign http://archive.raspbian.org wheezy/contrib Translation-en
Ign http://archive.raspbian.org wheezy/main Translation-en_GB
Ign http://archive.raspbian.org wheezy/main Translation-en
Ign http://archive.raspbian.org wheezy/non-free Translation-en_GB
Ign http://archive.raspbian.org wheezy/non-free Translation-en
Fetched 20.3 MB in 3min 24s (99.1 kB/s)
Reading package lists... Done
W: GPG error: http://vontaene.de . Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F0DAA5410C667A3E
root@raspberrypi:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
epiphany-browser wolfram-engine
The following packages will be upgraded:
bind9-host cups-bsd cups-client cups-common dbus dbus-x11 e2fslibs e2fsprogs
libbind9-80 libcomerr2 libcups2 libcupsimage2 libdbus-1-3 libdbus-1-dev
libdns88 libisc84 libisccc80 libisccfg82 liblwres80 libraspberrypi-bin
libraspberrypi-dev libraspberrypi-doc libraspberrypi0 libsmbclient libss2
libwbclient0 omxplayer python-pifacecommon python-rpi.gpio
python3-pifacecommon python3-rpi.gpio raspberrypi-bootloader samba-common
smbclient sonic-pi sudo uv4l-raspicam xdg-utils xserver-common
xserver-xorg-core
40 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Need to get 127 MB of archives.
After this operation, 5,933 kB disk space will be freed.
Do you want to continue [Y/n]? y
Get:1 http://archive.raspberrypi.org/debian/ wheezy/main omxplayer armhf 0.3.6~git20150210~337004e [3,576 kB]
Get:2 http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy/main uv4l-raspicam armhf 1.9.27 [1,377 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main e2fslibs armhf 1.42.5-1.1+deb7u1 [186 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main e2fsprogs armhf 1.42.5-1.1+deb7u1 [984 kB]
...
Install vscp_software
First we’ll install the vscp_software package. This depends on some other packages so we’ll install these first.
Install build-essential package
root@raspberrypi:~# apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Install libwxbase3.0-dev package
This packages is not available in the standard distributions so we’ll have to install it.
First add this line to your /etc/apt/sources.list file:
deb http://ftp.de.debian.org/debian wheezy-backports main
Then do sudo apt-get update to update the package list so it includes the packages from the new source we just added.
Then do apt-get install libwxbase3.0 to install the package.
root@raspberrypi:~# apt-get install libwxbase3.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libwxbase3.0-dev' for regex 'libwxbase3.0'
Note, selecting 'libwxbase3.0-0' for regex 'libwxbase3.0'
Note, selecting 'libwxbase3.0-0-dbg' for regex 'libwxbase3.0'
The following extra packages will be installed:
wx3.0-headers
Suggested packages:
wx3.0-doc
The following NEW packages will be installed:
libwxbase3.0-0 libwxbase3.0-0-dbg libwxbase3.0-dev wx3.0-headers
0 upgraded, 4 newly installed, 0 to remove and 2 not upgraded.
Need to get 14.3 MB of archives.
After this operation, 21.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
libwxbase3.0-0 wx3.0-headers libwxbase3.0-dev libwxbase3.0-0-dbg
Install these packages without verification [y/N]? Y
Get:1 http://ftp.de.debian.org/debian/ wheezy-backports/main libwxbase3.0-0 armhf 3.0.2-1~bpo70+1 [1,152 kB]
Get:2 http://ftp.de.debian.org/debian/ wheezy-backports/main wx3.0-headers armhf 3.0.2-1~bpo70+1 [1,517 kB]
Get:3 http://ftp.de.debian.org/debian/ wheezy-backports/main libwxbase3.0-dev armhf 3.0.2-1~bpo70+1 [135 kB]
Get:4 http://ftp.de.debian.org/debian/ wheezy-backports/main libwxbase3.0-0-dbg armhf 3.0.2-1~bpo70+1 [11.5 MB]
Fetched 14.3 MB in 9s (1,571 kB/s)
Selecting previously unselected package libwxbase3.0-0:armhf.
(Reading database ... 101119 files and directories currently installed.)
Unpacking libwxbase3.0-0:armhf (from .../libwxbase3.0-0_3.0.2-1~bpo70+1_armhf.deb) ...
Selecting previously unselected package wx3.0-headers.
Unpacking wx3.0-headers (from .../wx3.0-headers_3.0.2-1~bpo70+1_armhf.deb) ...
Selecting previously unselected package libwxbase3.0-dev.
Unpacking libwxbase3.0-dev (from .../libwxbase3.0-dev_3.0.2-1~bpo70+1_armhf.deb) ...
Selecting previously unselected package libwxbase3.0-0-dbg:armhf.
Unpacking libwxbase3.0-0-dbg:armhf (from .../libwxbase3.0-0-dbg_3.0.2-1~bpo70+1_armhf.deb) ...
Setting up libwxbase3.0-0:armhf (3.0.2-1~bpo70+1) ...
Setting up wx3.0-headers (3.0.2-1~bpo70+1) ...
Setting up libwxbase3.0-dev (3.0.2-1~bpo70+1) ...
update-alternatives: using /usr/lib/arm-linux-gnueabihf/wx/config/base-unicode-3.0 to provide /usr/bin/wx-config (wx-config) in auto mode
Setting up libwxbase3.0-0-dbg:armhf (3.0.2-1~bpo70+1) ...
For details see this page on packages.debian.org for more information.
Install telnet daemon
The Raspberry Pi doesn’t come with a Telnet server by default, but we’ll need it to be able to log on to the VSCP admin interface. So we’ll install it:
sudo apt-get install telnetd
root@raspberrypi:~/vscp_software# sudo apt-get install telnetd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
openbsd-inetd
The following NEW packages will be installed:
openbsd-inetd telnetd
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 77.4 kB of archives.
After this operation, 211 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main openbsd-inetd armhf 0.20091229-2 [36.1 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main telnetd armhf 0.17-36 [41.3 kB]
Fetched 77.4 kB in 0s (94.7 kB/s)
Selecting previously unselected package openbsd-inetd.
(Reading database ... 103101 files and directories currently installed.)
Unpacking openbsd-inetd (from .../openbsd-inetd_0.20091229-2_armhf.deb) ...
Selecting previously unselected package telnetd.
Unpacking telnetd (from .../telnetd_0.17-36_armhf.deb) ...
Processing triggers for man-db ...
Setting up openbsd-inetd (0.20091229-2) ...
Stopping internet superserver: inetd.
Not starting internet superserver: no services enabled.
Setting up telnetd (0.17-36) ...
Adding user telnetd to group utmp
Next we’ll start the telnet service:
sudo /etc/init.d/openbsd-inetd restart
root@raspberrypi:~/vscp_software# sudo /etc/init.d/openbsd-inetd restart
Restarting internet superserver: inetd.
root@raspberrypi:~/vscp_software#
Let’s verify if the telnet service is running:
netstat -a | grep telnet
root@raspberrypi:~/vscp_software# netstat -a | grep telnet
tcp 0 0 *:telnet *:* LISTEN
Since telnet is insecure you should limit who can access the RPi via Telnet. You can do so with the /etc/hosts.allow file. Add a line like this to /etc/hosts.allow to allow hosts on you local LAN
in.telnetd : 192.168.1. : allow
Install other misc packages
Issue the following commands to install additional packages:
- sudo apt-get install libssl-dev
- sudo apt-get install libpcap0.8-dev
- sudo apt-get install libcurl4-openssl-dev
- sudo apt-get install libpcap-dev
Output:
root@raspberrypi:~# apt-get install libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libssl-dev is already the newest version.
libssl-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
root@raspberrypi:~# apt-get install libpcap0.8-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libpcap0.8
The following NEW packages will be installed:
libpcap0.8 libpcap0.8-dev
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 380 kB of archives.
After this operation, 829 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libpcap0.8 armhf 1.3.0-1 [135 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libpcap0.8-dev armhf 1.3.0-1 [245 kB]
Fetched 380 kB in 0s (609 kB/s)
Selecting previously unselected package libpcap0.8:armhf.
(Reading database ... 101887 files and directories currently installed.)
Unpacking libpcap0.8:armhf (from .../libpcap0.8_1.3.0-1_armhf.deb) ...
Selecting previously unselected package libpcap0.8-dev.
Unpacking libpcap0.8-dev (from .../libpcap0.8-dev_1.3.0-1_armhf.deb) ...
Processing triggers for man-db ...
Setting up libpcap0.8:armhf (1.3.0-1) ...
Setting up libpcap0.8-dev (1.3.0-1) ...
root@raspberrypi:~# apt-get install libcurl4-openssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
comerr-dev krb5-multidev libgssrpc4 libidn11-dev libkadm5clnt-mit8
libkadm5srv-mit8 libkdb5-6 libkrb5-dev libldap2-dev libssh2-1-dev
Suggested packages:
doc-base krb5-doc libcurl3-dbg krb5-user
The following NEW packages will be installed:
comerr-dev krb5-multidev libcurl4-openssl-dev libgssrpc4 libidn11-dev
libkadm5clnt-mit8 libkadm5srv-mit8 libkdb5-6 libkrb5-dev libldap2-dev
libssh2-1-dev
0 upgraded, 11 newly installed, 0 to remove and 2 not upgraded.
Need to get 3,223 kB of archives.
After this operation, 6,656 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libgssrpc4 armhf 1.10.1+dfsg-5+deb7u3 [80.0 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libkadm5clnt-mit8 armhf 1.10.1+dfsg-5+deb7u3 [62.9 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libkdb5-6 armhf 1.10.1+dfsg-5+deb7u3 [61.2 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libkadm5srv-mit8 armhf 1.10.1+dfsg-5+deb7u3 [76.8 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ wheezy/main comerr-dev armhf 2.1-1.42.5-1.1+deb7u1 [42.7 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ wheezy/main krb5-multidev armhf 1.10.1+dfsg-5+deb7u3 [155 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libidn11-dev armhf 1.25-2 [661 kB]
Get:8 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libkrb5-dev armhf 1.10.1+dfsg-5+deb7u3 [40.5 kB]
Get:9 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libldap2-dev armhf 2.4.31-1+nmu2 [523 kB]
Get:10 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libssh2-1-dev armhf 1.4.2-1.1 [300 kB]
Get:11 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libcurl4-openssl-dev armhf 7.26.0-1+wheezy12 [1,221 kB]
Fetched 3,223 kB in 2s (1,131 kB/s)
Selecting previously unselected package libgssrpc4:armhf.
(Reading database ... 101984 files and directories currently installed.)
Unpacking libgssrpc4:armhf (from .../libgssrpc4_1.10.1+dfsg-5+deb7u3_armhf.deb) ...
Selecting previously unselected package libkadm5clnt-mit8:armhf.
Unpacking libkadm5clnt-mit8:armhf (from .../libkadm5clnt-mit8_1.10.1+dfsg-5+deb7u3_armhf.deb) ...
Selecting previously unselected package libkdb5-6:armhf.
Unpacking libkdb5-6:armhf (from .../libkdb5-6_1.10.1+dfsg-5+deb7u3_armhf.deb) ...
Selecting previously unselected package libkadm5srv-mit8:armhf.
Unpacking libkadm5srv-mit8:armhf (from .../libkadm5srv-mit8_1.10.1+dfsg-5+deb7u3_armhf.deb) ...
Selecting previously unselected package comerr-dev.
Unpacking comerr-dev (from .../comerr-dev_2.1-1.42.5-1.1+deb7u1_armhf.deb) ...
Selecting previously unselected package krb5-multidev.
Unpacking krb5-multidev (from .../krb5-multidev_1.10.1+dfsg-5+deb7u3_armhf.deb) ...
Selecting previously unselected package libidn11-dev.
Unpacking libidn11-dev (from .../libidn11-dev_1.25-2_armhf.deb) ...
Selecting previously unselected package libkrb5-dev.
Unpacking libkrb5-dev (from .../libkrb5-dev_1.10.1+dfsg-5+deb7u3_armhf.deb) ...
Selecting previously unselected package libldap2-dev:armhf.
Unpacking libldap2-dev:armhf (from .../libldap2-dev_2.4.31-1+nmu2_armhf.deb) ...
Selecting previously unselected package libssh2-1-dev.
Unpacking libssh2-1-dev (from .../libssh2-1-dev_1.4.2-1.1_armhf.deb) ...
Selecting previously unselected package libcurl4-openssl-dev.
Unpacking libcurl4-openssl-dev (from .../libcurl4-openssl-dev_7.26.0-1+wheezy12_armhf.deb) ...
Processing triggers for man-db ...
Processing triggers for install-info ...
Setting up libgssrpc4:armhf (1.10.1+dfsg-5+deb7u3) ...
Setting up libkadm5clnt-mit8:armhf (1.10.1+dfsg-5+deb7u3) ...
Setting up libkdb5-6:armhf (1.10.1+dfsg-5+deb7u3) ...
Setting up libkadm5srv-mit8:armhf (1.10.1+dfsg-5+deb7u3) ...
Setting up comerr-dev (2.1-1.42.5-1.1+deb7u1) ...
Setting up krb5-multidev (1.10.1+dfsg-5+deb7u3) ...
Setting up libidn11-dev (1.25-2) ...
Setting up libkrb5-dev (1.10.1+dfsg-5+deb7u3) ...
Setting up libldap2-dev:armhf (2.4.31-1+nmu2) ...
Setting up libssh2-1-dev (1.4.2-1.1) ...
Setting up libcurl4-openssl-dev (7.26.0-1+wheezy12) ...
root@raspberrypi:~# apt-get install libpcap-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libpcap-dev
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 22.2 kB of archives.
After this operation, 47.1 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libpcap-dev all 1.3.0-1 [22.2 kB]
Fetched 22.2 kB in 0s (60.3 kB/s)
Selecting previously unselected package libpcap-dev.
(Reading database ... 102888 files and directories currently installed.)
Unpacking libpcap-dev (from .../libpcap-dev_1.3.0-1_all.deb) ...
Setting up libpcap-dev (1.3.0-1) ...
Clone vscp_software repository from git
Now that the dependencies are installed, we’ll download the latest VSCP software onto our machine using git.
Git comes pre-installed on most Raspi distributions so you shouldn’t need to install it. Just issue git clone https://github.com/grodansparadis/vscp_software.
root@raspberrypi:~# git clone https://github.com/grodansparadis/vscp_software
Cloning into 'vscp_software'...
remote: Counting objects: 27347, done.
remote: Compressing objects: 100% (112/112), done.
remote: Total 27347 (delta 48), reused 0 (delta 0), pack-reused 27235
Receiving objects: 100% (27347/27347), 492.54 MiB | 475 KiB/s, done.
Resolving deltas: 100% (14355/14355), done.
Checking out files: 100% (6001/6001), done.
Install vscp_software package
The git clone above created a directory vscp_software. Go inside this directory (cd vscp_software) and execute the following commands:
- sudo ./configure
- sudo make clean
- sudo make
- sudo make install
You might also want to do these all at once in a single command (./configure ; make clean; make; make install) and let the build run overnight. On a Raspberry Pi it takes a long time to build this package.
root@raspberrypi:~/vscp_software# ./configure ; make clean; make; make install
If the installation is successful you should see:
Shall default web content be copied (y/n)? y
Your VSCP & Friends system is now installed.
============================================
- Start the VSCP daemon with 'sudo /etc/init.d/vscpd start'
or 'vscpd -s' to start the daemon in the foreground.
- Admin interface is at http://localhost:8080/vscp
- If you have installed the sample content it is located at
http://localhost:8080. Remember to change the ip address
in the file /srv/vscp/web/testws/settings.js to your local
ip address (192.168.1.7 ) to be able to access this content from other
machines than your local machine.
- You can reach core functionality in the telnet interface on
this machine at port 9598. Username: admin, Password: secret
- The configuration file for the VSCP daemon is at /etc/vscd/vscpd.conf and
you can read about the different available options here
http://www.vscp.org/docs/vscpd/doku.php?id=configuring_the_vscp_daemon
- Documentation is at http://www.vscp.org/docs/vscpd/doku.php asd more general
documentation is at http://www.vscp.org/docs
Have fun and remember to always be hungry and stay foolish or the other way
around be foolish - stay hungry! There is always a choice.
Install lsb package
This package should no longer be required to build vscp_software. If however your build should fail because this package is missing, here’s how to install it:
root@raspberrypi:~# apt-get install lsb-release
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
lsb
The following NEW packages will be installed:
lsb-release
0 upgraded, 1 newly installed, 0 to remove and 42 not upgraded.
Need to get 26.8 kB of archives.
After this operation, 105 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main lsb-release all 4.1+Debian8+rpi1+deb7u1 [26.8 kB]
Fetched 26.8 kB in 0s (47.6 kB/s)
Selecting previously unselected package lsb-release.
(Reading database ... 101085 files and directories currently installed.)
Unpacking lsb-release (from .../lsb-release_4.1+Debian8+rpi1+deb7u1_all.deb) ...
Processing triggers for man-db ...
Setting up lsb-release (4.1+Debian8+rpi1+deb7u1) ...
Re-compile the Linux kernel
The standard Linux kernel for Raspi unfortunately comes without support for CAN, so we’ll have to re-compile the kernel with CAN support.
Because compiling the kernel on the Raspi itself would take a very long time (think days), we’ll be cross-compiling it on an Ubuntu machine.
Install dependencies
First we’ll need to install some packages we’ll need to cross-compile the kernel: the git-core and the gcc compiler for the ARM architecture.
sudo apt-get install git-core gcc-4.6-arm-linux-gnueabi
Get source
Next we’ll get the sources and some tools from git.
mkdir raspberrypi
cd raspberrypi
git clone https://github.com/raspberrypi/tools.git
git clone https://github.com/raspberrypi/linux.git
cd linux
Create config file
Next let’s generate the .config file based on the pre-packaged Raspberry Pi config file.
make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- bcmrpi_cutdown_defconfig
Possibly the config file arm-linux-gnueabi- bcmrpi_cutdown_defconfig might not be available in the source we just downloaded. In this case check the linux/arch/arm/configs folder for a similar file starting with bcmrpi and ending with defconfig. In my case I used:
make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- bcmrpi_defconfig
Change the kernel configuration
Next we’ll have to change the kernel configuration to include CAN support.
make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- menuconfig
Enable CAN in the Networking menu.
There’s a pre-built kernel image and config file available for download in the Resources section below.
Build the kernel
Once you have made the desired changes, save and exit the menuconfig screen. Now we are ready to start the build. You can speed up the compilation process by enabling parallel make with the -j flag. The recommended use is processor cores + 1, e.g. 3 if you have a dual core processor:
make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -k -j3
Assuming the compilation was successful, create a directory for the modules:
mkdir ../modules
Then compile and install the loadable modules to the temp directory:
make modules_install ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- INSTALL_MOD_PATH=../modules/
Now we need to use imagetool-uncompressed.py from the tools repo to get the kernel ready for the Pi.
cd ../tools/mkimage/
./imagetool-uncompressed.py ../../linux/arch/arm/boot/Image
This creates a kernel.img image file in the current directory. Plug in the SD card containing the existing Debian image that you wish to install the new kernel on. Mount the boot partition. Delete the existing kernel.img and replace it with the new one, substituting boot-partition-uuid with the identifier of the partition as it is mounted in Ubuntu.
sudo rm /media/boot-partition-uuid/kernel.img
sudo mv kernel.img /media/boot-partition-uuid/
Next, remove the existing /lib/modules and lib/firmware directories, substituting “rootfs-partition-uuid” with the identifier of the root file system partition mounted in Ubuntu.
sudo rm -rf /media/rootfs-partition-uuid/lib/modules/
sudo rm -rf /media/rootfs-partition-uuid/lib/firmware/
Go to the destination directory of the previous make modules_install, and copy the new modules and firmware in their place:
cd ../../modules/
sudo cp -a lib/modules/ /media/rootfs-partition-uuid/lib/
sudo cp -a lib/firmware/ /media/rootfs-partition-uuid/lib/
sync
That’s it! Eject the SD card, and boot the new kernel on the Raspberry PI.
Testing the VSCP installation
Admin interface - Telnet
Telnet to 192.168.1.7 port 9598 and you should see the following:
Admin web page
Point your browser to http://192.168.1.7:8080/vscp and you should see this page:
Example web content
Point your browser to http://192.168.1.7:8080/ and you should see this page:
Resources
- setting up the VSCP daemon on Unix
- Raspberry Pi Kernel Compile
- Raspberry Pi Kernel Compilation -Cross compiling from Linux
- Kernel image with CAN
- rpi-config